package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.SafeB236;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class SafeB236Converter implements AttributeConverter<SafeB236, String> {
    @Override
    public String convertToDatabaseColumn(SafeB236 safeB236) {
        return JSONUtil.toJsonStr(safeB236);
    }

    @Override
    public SafeB236 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, SafeB236.class);
    }
}
